package com.example.sls.controller.field;

import com.example.sls.pojo.field.FieldUsageStatistics;
import com.example.sls.service.intserfaces.field.FieldUsageStatisticsService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 场地使用统计表(FieldUsageStatistics)表控制层
 *
 * @author 蓝江富
 * @since 2024-06-19 13:23:44
 */
@RestController
@RequestMapping("field/fieldUsageStatistics")
public class FieldUsageStatisticsController {
  @Autowired
  FieldUsageStatisticsService fieldUsageStatisticsService;

  @GetMapping("queryById")
  FieldUsageStatistics queryById(Integer id) {
    return fieldUsageStatisticsService.queryById(id);
  }

  @GetMapping("queryAllByLimit")
  List<FieldUsageStatistics> queryAllByLimit(FieldUsageStatistics fieldUsageStatistics, Integer pageSize, Integer offset) {
    return fieldUsageStatisticsService.queryAllByLimit(fieldUsageStatistics, pageSize, offset);
  }

  @GetMapping("count")
  long count() {
    return fieldUsageStatisticsService.count();
  }

  @GetMapping("insert")
  int insert(FieldUsageStatistics fieldUsageStatistics) {
    return fieldUsageStatisticsService.insert(fieldUsageStatistics);
  }

  @GetMapping("update")
  int update(FieldUsageStatistics fieldUsageStatistics) {
    return fieldUsageStatisticsService.update(fieldUsageStatistics);
  }

  @GetMapping("deleteById")
  int deleteById(Integer id) {
    return fieldUsageStatisticsService.deleteById(id);
  }
}

